//
//  ASRProjectDetailVC.m
//  AttendenceSys
//
//  Created by 窦芳俊 on 16/5/23.
//  Copyright © 2016年 窦芳俊. All rights reserved.
//

#import "ASRProjectDetailVC.h"

@interface ASRProjectDetailVC ()

@end

@implementation ASRProjectDetailVC

- (instancetype)initWithResearchInfo:(ASResearchInfo *)rInfo typeName:(NSString *)tName
{
    self = [super init];
    if (self)
    {
        _resInfo = rInfo;
        _typeName = tName;
    }
    
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    
    self.strNavTitle = _typeName;
    
    [self initUI];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
}

- (void)initUI
{
    /////////    项目
    //    项目名称
    //    立项单位
    //    立项时间
    //    结项时间（未结项，或者具体时间）
    //    项目级别：院级、校级、省级、国家级
    //    成员排名：第一成员、第二成员、第三。。。。第八
    //    项目描述
    
    CGFloat padding = 10.0f;
    CGFloat width = self.view.frame.size.width;
    
    // 项目名称
    _rInfoA = [[UILabel alloc] initWithFrame:CGRectMake(padding, 20, width - padding * 2, 20)];
    _rInfoA.font = [UIFont systemFontOfSize:16];
    _rInfoA.text = [NSString stringWithFormat:@"项目名称: %@", _resInfo.researchA];
    [_rInfoA setTextAlignment:NSTextAlignmentLeft];
    _rInfoA.textColor = [UIColor colorWithRed:102.0/255.0 green:102.0/255.0 blue:102.0/255.0 alpha:1.0];
    [self.view addSubview:_rInfoA];
    
    // 立项单位
    _rInfoB = [[UILabel alloc] initWithFrame:CGRectZero];
    _rInfoB.frame = CGRectMake(padding,
                               _rInfoA.frame.origin.y + _rInfoA.frame.size.height + 18,
                               width - padding * 2,
                               20);
    _rInfoB.font = [UIFont systemFontOfSize:16];
    _rInfoB.text = [NSString stringWithFormat:@"立项单位: %@", _resInfo.researchB];
    [_rInfoB setTextAlignment:NSTextAlignmentLeft];
    _rInfoB.textColor = [UIColor colorWithRed:102.0/255.0 green:102.0/255.0 blue:102.0/255.0 alpha:1.0];
    [self.view addSubview:_rInfoB];
    
    // 立项时间
    _rInfoC = [[UILabel alloc] initWithFrame:CGRectZero];
    _rInfoC.frame = CGRectMake(padding,
                               _rInfoB.frame.origin.y + _rInfoB.frame.size.height + 18,
                               width - padding * 2,
                               20);
    _rInfoC.font = [UIFont systemFontOfSize:16];
    _rInfoC.text = [NSString stringWithFormat:@"立项时间: %@", _resInfo.researchC];
    [_rInfoC setTextAlignment:NSTextAlignmentLeft];
    _rInfoC.textColor = [UIColor colorWithRed:102.0/255.0 green:102.0/255.0 blue:102.0/255.0 alpha:1.0];
    [self.view addSubview:_rInfoC];
    
    // 结项时间
    _rInfoD = [[UILabel alloc] initWithFrame:CGRectZero];
    _rInfoD.frame = CGRectMake(padding,
                               _rInfoC.frame.origin.y + _rInfoC.frame.size.height + 18,
                               width - padding * 2,
                               20);
    _rInfoD.font = [UIFont systemFontOfSize:16];
    _rInfoD.text = [NSString stringWithFormat:@"结项时间: %@", _resInfo.researchD];
    [_rInfoD setTextAlignment:NSTextAlignmentLeft];
    _rInfoD.textColor = [UIColor colorWithRed:102.0/255.0 green:102.0/255.0 blue:102.0/255.0 alpha:1.0];
    [self.view addSubview:_rInfoD];
    
    // 项目级别
    _rInfoE = [[UILabel alloc] initWithFrame:CGRectZero];
    _rInfoE.frame = CGRectMake(padding,
                               _rInfoD.frame.origin.y + _rInfoD.frame.size.height + 18,
                               width - padding * 2,
                               20);
    _rInfoE.font = [UIFont systemFontOfSize:16];
    _rInfoE.text = [NSString stringWithFormat:@"项目级别: %@", _resInfo.researchE];
    [_rInfoE setTextAlignment:NSTextAlignmentLeft];
    _rInfoE.textColor = [UIColor colorWithRed:102.0/255.0 green:102.0/255.0 blue:102.0/255.0 alpha:1.0];
    [self.view addSubview:_rInfoE];
    
    // 成员排名
    _rInfoF = [[UILabel alloc] initWithFrame:CGRectZero];
    _rInfoF.frame = CGRectMake(padding,
                               _rInfoE.frame.origin.y + _rInfoE.frame.size.height + 18,
                               width - padding * 2,
                               20);
    _rInfoF.font = [UIFont systemFontOfSize:16];
    _rInfoF.text = [NSString stringWithFormat:@"成员排名: %@", _resInfo.researchF];
    [_rInfoF setTextAlignment:NSTextAlignmentLeft];
    _rInfoF.textColor = [UIColor colorWithRed:102.0/255.0 green:102.0/255.0 blue:102.0/255.0 alpha:1.0];
    [self.view addSubview:_rInfoF];
    
    // 项目描述
    _rInfoG = [[UILabel alloc] initWithFrame:CGRectZero];
    _rInfoG.frame = CGRectMake(padding,
                               _rInfoF.frame.origin.y + _rInfoF.frame.size.height + 18,
                               width - padding * 2,
                               20);
    _rInfoG.font = [UIFont systemFontOfSize:16];
    _rInfoG.text = [NSString stringWithFormat:@"项目描述: %@", _resInfo.researchG];
    [_rInfoG setTextAlignment:NSTextAlignmentLeft];
    _rInfoG.textColor = [UIColor colorWithRed:102.0/255.0 green:102.0/255.0 blue:102.0/255.0 alpha:1.0];
    [self.view addSubview:_rInfoG];
    
    //[self initScrollView:_releaseArrImage];
}

@end
